package test04;

import java.util.Arrays;
import java.lang.reflect.Method;

/**
 * @Author czl
 * @Date 2024-04-16
 */
public class MainTest01 {
    public static void main(String[] args) {
        Arrays.stream(UserService.class.getDeclaredMethods())
                .filter(m->m.isAnnotationPresent(ExceptionHandler.class))
                .sorted((m1,m2)->m1.getAnnotation(ExceptionHandler.class).value().isAssignableFrom(m2.getAnnotation(ExceptionHandler.class).value())?1:-1)
                .map(Method::getName)
                .forEach(System.out::println);
    }
}
